//
//  PPAbstractPictureViewController.h
//  pickpic
//
//  Created by Jinxiao on 9/17/16.
//  Copyright © 2016 MicroDream. All rights reserved.
//

#import "PPAbstractViewController.h"

@class PPAbstractPictureViewCell;

@protocol PPAbstractPictureViewCellDelegate <NSObject>

- (void)pictureViewCell:(PPAbstractPictureViewCell *)pictureViewCell didRecognizedSingleTapGesture:(UITapGestureRecognizer *)gesture;
- (void)pictureViewCell:(PPAbstractPictureViewCell *)pictureViewCell didRecognizedLongPressGesture:(UILongPressGestureRecognizer *)gesture;

@end

@interface PPAbstractPictureViewController : PPAbstractViewController <UICollectionViewDelegate, UICollectionViewDataSource>
@property ( nonatomic, strong) UICollectionView *collectionView;
@property (readwrite, nonatomic, strong) NSArray <PPAbstractArtwork *> *artworks;

- (void)reloadImages;
- (void)reloadImageAtIndex:(NSInteger)index;

@property (readwrite, nonatomic, assign) NSInteger index;

- (void)scrollIndexToVisible:(NSInteger)index animated:(BOOL)animated;

#pragma mark - Overwrite

- (void)pictureViewCell:(PPAbstractPictureViewCell *)pictureViewCell didRecognizedSingleTapGesture:(UITapGestureRecognizer *)gesture;
- (void)pictureViewCell:(PPAbstractPictureViewCell *)pictureViewCell didRecognizedLongPressGesture:(UILongPressGestureRecognizer *)gesture;

- (void)willBeginScrolling;
- (void)didEndScrolling;

- (UIEdgeInsets)scrollViewEdgeInsets;

@end

@interface PPAbstractPictureViewCell : UICollectionViewCell <UIScrollViewDelegate>

@property (readwrite, nonatomic, weak) id<PPAbstractPictureViewCellDelegate> delegate;

@property (readwrite, nonatomic, strong) PPAbstractArtwork *artwork;

@property (readwrite, nonatomic, strong) UIImageView *pictureView;

@property (readwrite, nonatomic, strong) PPAbstractScrollView *scrollView;

@property (readonly) UIImage *image;

@property (readwrite, nonatomic, assign) NSInteger index;

@property (nonatomic,strong) PPAbstractViewController *abstractVc;

@end
